package org.pr.ddddesigner.interfaces.dto;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.util.UUID;

/**
 * @description:
 * @projectName:DDD-Designer
 * @see:org.pr.ddddesigner.interfaces.dto
 * @author:LXC
 * @createTime:2024/4/19 14:01
 * @version:1.0
 */
@Schema(description = "创建用户")
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public class CreateUser{
    //private static final long serialVersionUID = -9085952353374185653L;

//    @JsonProperty("userId")
    private UUID userId;

    @Schema(required = true, description = "用户姓名")
    @NotNull(message = "用户姓名不能为空")
//    @JsonProperty("userName")
    private String userName;

    @Schema(required = true, description = "用户年龄")
    @NotNull(message = "用户年龄不能为空")
//    @JsonProperty("userAge")
    private Integer userAge;

    public CreateUser() {
    }

    @JsonCreator
    public CreateUser(@JsonProperty("userId") UUID userId,
                      @JsonProperty("userName") String userName,
                      @JsonProperty("userAge") Integer userAge) {
        this.userId=userId;
        this.userName = userName;
        this.userAge = userAge;
    }

    public UUID getUserId() {
        return userId;
    }

    public void setUserId(UUID userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getUserAge() {
        return userAge;
    }

    public void setUserAge(Integer userAge) {
        this.userAge = userAge;
    }
}

